UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r+vFZt9dLmNohNzWvlhPgEGKBBj0VR4MSnXKWECwDjg=' 
WHERE 
  key_id = 'ed308595d2e7e9f76f2d4f56cc1d694cd0c07c5fb263bc2a5eda00349cc59eb9' 
  AND (
    token = 'r+vFZt9dLmNohNzWvlhPgEGKBBj0VR4MSnXKWECwDjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038