UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'n/TVvhzARDsIAAx4diR3g2OF2AsfRkaQWSJr4onhozM=' 
WHERE 
  key_id = '526aaf54eac94268a63cc18c17b0227dbeec2f11982729ec627a89f866952d6c' 
  AND (
    token = 'n/TVvhzARDsIAAx4diR3g2OF2AsfRkaQWSJr4onhozM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025