UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eIYTuqqE9ckDzMF2nd2vQmxsXpHZCde8IPTjszl+7sI=' 
WHERE 
  key_id = 'da13219eb2d3ffa1fd86181feef0aa022f4e676ba678d7031d2d2aa5a89f1e27' 
  AND (
    token = 'eIYTuqqE9ckDzMF2nd2vQmxsXpHZCde8IPTjszl+7sI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031