UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FADSIYnnvn/1Ccw5JYFQkCzqSxfu3/rITXwOM0rWZ9w=' 
WHERE 
  key_id = 'c2e12e2360c8987d63d8d4bcd3a0754d325f9d8c4ca20a93dabff35a1fddcf6b' 
  AND (
    token = 'FADSIYnnvn/1Ccw5JYFQkCzqSxfu3/rITXwOM0rWZ9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036