UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sXofwPTw4LPXdWe8QqmCnbtM+Ha5HNaugLBiKBVIYvE='
WHERE
key_id = '22b3fee9e614470d72b76821902a8fad6569f79066ee827754650faa137c5e3a'
AND (
token = 'sXofwPTw4LPXdWe8QqmCnbtM+Ha5HNaugLBiKBVIYvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)