UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+UrE7AwHZyHaeSJCgStQtFMQynAffdNgGnwZgPe+oUg=' 
WHERE 
  key_id = '1f40fd3b13bb24e86318b1c28beb002a5b492a1c60851dcda05ce0d5f5acc12e' 
  AND (
    token = '+UrE7AwHZyHaeSJCgStQtFMQynAffdNgGnwZgPe+oUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062