UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'laGta778MtGAmfl6DGvKahQHHc94prOVvAOBl2ggJ6I='
WHERE
key_id = '3b4b3b0746ccf957d1d3807956a5c57495418620702c7a4b3cea6a2d6208ffae'
AND (
token = 'laGta778MtGAmfl6DGvKahQHHc94prOVvAOBl2ggJ6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)