UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XOOXLG+6qZoiVPOsqso1LjrC2wECkhE5hkL5hCo8hvM='
WHERE
key_id = '6b0a66b4dec1502dd28fba83426977c2d4fc79808b452bba31f2345d24723abf'
AND (
token = 'XOOXLG+6qZoiVPOsqso1LjrC2wECkhE5hkL5hCo8hvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)