UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F03lSxft/A5WSInkatoOyv1lQkAlDflj33cJoEO3wwQ='
WHERE
key_id = 'db248c74b3ae51642fa24d93caac7544a5894fcc8c2957248a21df48635f3813'
AND (
token = 'F03lSxft/A5WSInkatoOyv1lQkAlDflj33cJoEO3wwQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)