UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qH4go9gQVSVymAqPNHiPIzO1w3eciykrkmSvTVjsagI='
WHERE
key_id = 'bce1b2abd1a911e5df8d82b6be41e6c516141e40ffdceb768d9489d2a9386e3a'
AND (
token = 'qH4go9gQVSVymAqPNHiPIzO1w3eciykrkmSvTVjsagI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)