UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vxxIZh8sW1aJsgBC/fGRwLN1jp0A3Mzlu1e6w2/FlaA=' 
WHERE 
  key_id = '907368090620720fe42660739f87f134ccef9bd406fc3e50337cff300afb4dab' 
  AND (
    token = 'vxxIZh8sW1aJsgBC/fGRwLN1jp0A3Mzlu1e6w2/FlaA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048