UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GGJb/oUweSNiApwBK4NYj8u8yCvQjhO0Ba7we9od1v4=' 
WHERE 
  key_id = '90362a6183ab80f072377fd0c6a3f88eed41662291044b2e303add639008a449' 
  AND (
    token = 'GGJb/oUweSNiApwBK4NYj8u8yCvQjhO0Ba7we9od1v4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040