UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fXSH1lbNCwlw3zYb5BX3KyJY9OB+Rh9fdC28prncflA=' 
WHERE 
  key_id = 'ccf75c497f1c6c3813b87c07dca8a1b1701fa7709997070b67fbfe5253bc16f9' 
  AND (
    token = 'fXSH1lbNCwlw3zYb5BX3KyJY9OB+Rh9fdC28prncflA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023