UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IrbDE45jJVlypxOg4UN2zemOLnD3eIt6Vrj6BxHgXls=' 
WHERE 
  key_id = '95ff4a858aa705d2ef3d9afcbf97d0a4b71d94ccc0be9a076762b579b4260c0f' 
  AND (
    token = 'IrbDE45jJVlypxOg4UN2zemOLnD3eIt6Vrj6BxHgXls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046