UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't1AEPxCe4ABKb+gnOhXfCso8aB2NwiTo5eaiMB0+A2c=' 
WHERE 
  key_id = 'f8db507e05d7a2e3170c306cc5337dee5b369497f8f1c7db82b70a093b55deb6' 
  AND (
    token = 't1AEPxCe4ABKb+gnOhXfCso8aB2NwiTo5eaiMB0+A2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029