UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lIlNbGnsJcywhdwXWe+aivZp/YbYXLzXBD5ol+goUFE='
WHERE
key_id = 'bf33431d9d356696aeab3bbb49c952cb562164dd22cfcf3422bb0ae868dd0cba'
AND (
token = 'lIlNbGnsJcywhdwXWe+aivZp/YbYXLzXBD5ol+goUFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)