UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6HG2RJGKALYXz1SHW44HDHcRSVz/H2VW+70dKAZu7+0='
WHERE
key_id = '4c08ab5907319918a908cf3dc6803cf8be7eb634e5fd49e74f621342990ce652'
AND (
token = '6HG2RJGKALYXz1SHW44HDHcRSVz/H2VW+70dKAZu7+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)