UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pbIMe5l2vhZsyqz7vklTVbxrO30d6Fv2Pffqy4MOrYE='
WHERE
key_id = 'e855fab442fcb6c06b1aa9d71d1ed7bd88baa47b7d1684b8558d48a2b8b471df'
AND (
token = 'pbIMe5l2vhZsyqz7vklTVbxrO30d6Fv2Pffqy4MOrYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)