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