UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A1LM+xyIwxPycGyFXdDGegbFpmKVEvE1MyYTnpL8CHY='
WHERE
key_id = 'b373f4c691eb00dcf31aef8d1bff24229a24b498bd63b2f25a97195ea0939f0d'
AND (
token = 'A1LM+xyIwxPycGyFXdDGegbFpmKVEvE1MyYTnpL8CHY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)