UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nluJMe5LCWyTs743xoBXWx5tLTTiQ+W43yLOdVKXSvE='
WHERE
key_id = '79365502081d958dcc5556cbaf973f33aa4722d0b62bbdefdedbef8a7e584854'
AND (
token = 'nluJMe5LCWyTs743xoBXWx5tLTTiQ+W43yLOdVKXSvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)