UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F/S6X003SbrqOQBisDgFTL3Bic700C6GlggbsDt06g4='
WHERE
key_id = 'e3325dcea052fa7e9dfd2f66d614ee454c504006342b0a2b019b2f8bd854c88e'
AND (
token = 'F/S6X003SbrqOQBisDgFTL3Bic700C6GlggbsDt06g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)