UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WwlQ9DUgLYVSBm5pOUq2K5x4BXXb1lIVdnNPCqBkpAk=' 
WHERE 
  key_id = 'ed45f75de84fc1a86c77275d7dec23a14ac4b1e085783c9f742659a86c584b72' 
  AND (
    token = 'WwlQ9DUgLYVSBm5pOUq2K5x4BXXb1lIVdnNPCqBkpAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033