UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1hefLitS5zDxcEQ/kLieNgS91MD3OyrAOaodlMnkaGI=' 
WHERE 
  key_id = 'ba41229ef34e6bff5505824d7d4cd618a1a5972ebe248b5c82ac5085e7061791' 
  AND (
    token = '1hefLitS5zDxcEQ/kLieNgS91MD3OyrAOaodlMnkaGI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025