UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pmpjrbaeQpO6fZ3noTZixptFmyrhdcsRo8ufu5eXb/U='
WHERE
key_id = '87168ee38d6e0c83ff7c1ac51b998e6929a18bd8b23257a798d3aa9900b50c9a'
AND (
token = 'pmpjrbaeQpO6fZ3noTZixptFmyrhdcsRo8ufu5eXb/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)