UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UtEUbvsIyg57ak40tf+Va5yvx4dPuyksHhx8tsJ+cdg=' 
WHERE 
  key_id = '843c148c9a0e8d2f00ec4fe2f62de2a70927581239fcb356e1e356590174159f' 
  AND (
    token = 'UtEUbvsIyg57ak40tf+Va5yvx4dPuyksHhx8tsJ+cdg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036