UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Sd84ofmsD+MusjbUdUQe+H1ZhI0bWknAO15e6QCf/8=' 
WHERE 
  key_id = 'eb8f3abfab6506f9fd7add934552af49d3d45612e9f9cb752c22b9d742184b03' 
  AND (
    token = '9Sd84ofmsD+MusjbUdUQe+H1ZhI0bWknAO15e6QCf/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032