UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iak7CwnmjC/1mzW3M0hCJQFQztmZhAofJ1QKQN7b7m4='
WHERE
key_id = '2861b3786f4c32301ada35dda00bd861f4c7253c571b53e3088abd82a7210c1c'
AND (
token = 'iak7CwnmjC/1mzW3M0hCJQFQztmZhAofJ1QKQN7b7m4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)