UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QjkaKkEqyxwYMUpZ/d8DQiZBZ5Qfs6/t9hwQ+eZCMWU='
WHERE
key_id = 'af88a52b420ea8901af9b4ffcd96314ce6bcbd96715df46677f6e12d54df5ac3'
AND (
token = 'QjkaKkEqyxwYMUpZ/d8DQiZBZ5Qfs6/t9hwQ+eZCMWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)