UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q/1NYqVOsmHiL3z/ozUNLL6lGUrHlA/n8ZFQj/tfdqg='
WHERE
key_id = '15535b3c1527d32b0176ab5051a304813ae3a3adb49f12950f6d45729661864e'
AND (
token = 'q/1NYqVOsmHiL3z/ozUNLL6lGUrHlA/n8ZFQj/tfdqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)