UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p83i2PR8HFGDTOkkbauEfHByGPzWX9IBeeUQea11AJM='
WHERE
key_id = '9dbc5b1eaf5ca55581203336dc112d0945973621fc86c79c3322f747539ac372'
AND (
token = 'p83i2PR8HFGDTOkkbauEfHByGPzWX9IBeeUQea11AJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)